package com.codeduck.mock.demo;

import java.util.Calendar;
import java.util.List;

/**
 * @author: <a href="mailto:codeduck@163.com">codeduck</a>
 * @date: 2023/01/10
 */
public class StaticDemo {

    public String test() {
        Calendar calendar = Calendar.getInstance();
        int today = calendar.get(Calendar.DATE);
        calendar.add(Calendar.DATE, 1);
        int tomorrow = calendar.get(Calendar.DATE);
        if (tomorrow % 10 == today % 10) {
            return "true";
        }
        return "false";
    }


    public static void main(String[] args) {
        Calendar instance = Calendar.getInstance();
        instance.set(2022,12,31);
        System.out.println(instance.get(Calendar.DATE));
    }

    public String chechAuth(){
        Calendar from = Calendar.getInstance();
        if(from.get(Calendar.DATE) % 10 == 0){
            from.add(Calendar.YEAR, -10);
        }
        Calendar to = Calendar.getInstance();
        to.add(Calendar.MONTH, 2);

        System.out.println("from: "+from.getTime());
        System.out.println("to: "+to.getTime());

        return "";
    }
}
